package com.xframe.domain.e3sp.bu.sale;

import com.xframe.domain.BaseModel;
import com.xframe.domain.e3sp.maindata.domestic.Dealer;
import com.xframe.domain.e3sp.maindata.domestic.Discount;
import com.xframe.domain.e3sp.maindata.domestic.DiscountDetail;
import com.xframe.xdal.core.annotation.AutoFill;
import com.xframe.xdal.core.annotation.XBelongsTo;
import com.xframe.xdal.core.annotation.XColumn;
import com.xframe.xdal.core.annotation.XTable;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;


/**
 * @Description: 折扣单
 * @ClassName: com.xframe.domain.e3sp.bu.sale.DiscountBill
 * @Author: xufeng
 * @CreateTime: 2024/4/19
 **/
@Data
@Accessors(chain=true)
@XTable(value = "bu_t01_discount_bill", label = "折扣单",dataSourceCode = "warehouse")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.domestic.Discount",foreignKey = "discountId", targetKey = "discountId",as = "refDiscount")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.domestic.DiscountDetail",foreignKey = "discountDetailId", targetKey = "discountDetailId",as = "refDiscountDetail")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.maindata.domestic.Dealer",foreignKey = "dealerId", targetKey = "dealerId",as = "refDealer")
public class DiscountBill extends BaseModel {


    /**
     * 折扣单ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "discount_bill_id", primaryKeyFlag = true,desc = "折扣单ID")
    private Long discountBillId;

    /**
     * 备件折扣大类ID
     */
    @XColumn(name = "discount_id",desc = "备件折扣大类ID")
    private Long discountId;
    /**
     * 备件折扣小类ID
     */
    @XColumn(name = "discount_detail_id",desc = "备件折扣小类ID")
    private Long discountDetailId;
    /**
     * 经销商ID
     */
    @XColumn(name = "dealer_id",desc = "经销商ID")
    private Long dealerId;

    /**
     * 折扣金额
     */
    @XColumn(name = "discount_amount",desc = "折扣金额")
    private BigDecimal amount;

    /**
     * 月
     */
    @XColumn(name = "v_month",desc = "月")
    private Integer month;

    /**
     * 年
     */
    @XColumn(name = "v_year",desc = "年")
    private Integer year;

    /**
     * 状态 '1','新建','2','提交业务审核','3','业务审核通过','4','财务审核通过','9','财务反审核通过'
     */
    @XColumn(name = "status",desc = "状态",length = 20)
    private String status;
    /**
     * 备注
     */
    @XColumn(name = "remark",desc = "备注",nullFlag = true, length = 500)
    private String remark;
    /**
     * 折扣大类
     */
    private Discount refDiscount;

    /**
     * 折扣小类
     */
    private DiscountDetail refDiscountDetail;

    /**
     * 国内经销商
     */
    private Dealer refDealer;
}
